package kr.couponplay.android.activity.deal.category;

import kr.couponplay.android.Category;
import kr.couponplay.android.activity.R;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

public class CategoryAdapter extends ArrayAdapter<Category> {
	public CategoryAdapter(Context context) {
		super(context, 0);
	}

	public View getView(int position, View convertView, ViewGroup parent) {
		if (convertView == null) {
			convertView = LayoutInflater.from(getContext()).inflate(R.layout.category_row, null);
		}
		
		String categoryName = getItem(position).getName();
		if (position == 0) {
			categoryName = categoryName + " 전체";
		}
		
		TextView titleView = (TextView) convertView.findViewById(R.id.row_title);
		titleView.setText(categoryName);
		return convertView;
	}
//	
//	public Category getItem(int position) {
//		return deals.get(position);
//	}
//	
//	public long getItemId(int position) {
//		return deals.get(position).getId();
//	}
//	
//	public int getItemSize() {
//		return deals.size();
//	}	
}
